#pragma once
#include "cocos2d.h"

USING_NS_CC;
class CTower : public cocos2d::CCNode
{
public:
	CTower();
	~CTower(void);

	void update(float dt);
	void draw(void);
	void fire( CCPoint direction );

	CC_SYNTHESIZE( CCSprite*, mSprite, Sprite );
	CC_SYNTHESIZE( float, mCoolDown, CoolDown );
	CC_SYNTHESIZE( float, mAttackRange, AttackRange );
	CC_SYNTHESIZE( float, mAttackDamage, AttackDamage );
	CC_SYNTHESIZE( float, mAttackSpeed, AttackSpeed );
	CC_SYNTHESIZE( int, mCost, Cost );

private:
	float mCoolDownMeasure;
};

CTower * CreateTower( cocos2d::CCLayer* pLayer, cocos2d::CCPoint Position );

class CBullte : public CCNode
{
friend CBullte * CreateBullte( CCLayer* pScene, CCPoint Position, CCPoint Direction, float fSpeed );
private:
	CBullte();
	virtual ~CBullte();

	void update(float dt);

	CC_SYNTHESIZE( float, mSpeed, Speed );
	CC_SYNTHESIZE( CCPoint, mDirection, Direction );
	CC_SYNTHESIZE( float, mRadius, Radius );
};

CBullte * CreateBullte( CCLayer* pScene, CCPoint Position, CCPoint Direction, float fSpeed );